    <%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/validate.jsp"%>
<%@ include file="function.jsp"%>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>医生信息</title>
    <link  href="../images/favicon.ico?cache=<%=Math.random()%>" rel="shortcut icon" type="image/x-icon">
    <link rel="stylesheet" href="../css/public.css?cache=<%=Math.random()%>">
    <link rel="stylesheet" href="../css/user_manage.css?cache=<%=Math.random()%>">
    <link rel="stylesheet" href="../css/laydate.css?cache=<%=Math.random()%>" >
    <link rel="stylesheet" href="../css/reset.css?cache=<%=Math.random()%>" />
    <link rel="stylesheet" href="../css/pageCode.css?cache=<%=Math.random()%>" />
    <script src="../js/jquery-1.9.1.min.js"></script>
    <script src="../js/laydate.js"></script>
</head>
<body>
<%@ include file="../header.jsp"%>
    <!--内容-->
<div class="containerone">
 <%@ include file="../left_menu.jsp"%>
    <!--右边内容-->
<div class="right_cont_user" id="doctor_detail">
  <div class="user_top">
      <div id="time_choose"  class="date_choose laydate-icon"></div>
    <div class="search_people"><input type="text" name="search_people" placeholder="昵称/就诊人姓名/"><button class="make_sure"  @click="keywords_search()">确定</button></div>
  </div>

    <div class="user_content_box">
    <table class="user_table">
       <tr class="user_tr_tittle">
       <td class="head_img">头像</td>
       <td class="ui_width">昵称</td>
       <td class="ui_width">绑定人数</td>
       <td class="ui_width">姓名</td>
       <td class="ui_width">注册时间</td>
       </tr>
    <tbody id="content">
    <template v-for="user in users.rank">
        <tr class="user_tr_content">
        <td class="head_img"><img :src="user.avatar" alt=""></td>
        <td class="ui_width" v-html='user.user_name'></td>
        <td class="ui_width" v-html='user.famliy'></td>
        <td class="ui_width" v-html='user.name'></td>
        <td class="ui_width" v-html='user.create_time'></td>
        </tr>
    </template>
    </tbody>
    </table>
     <%--<div class="user_page">--%>
          <%--<div class="tcdPageCode"></div>--%>
     <%--</div>--%>
    <div class="split_pages">
    <div class="record">共<span class="ui_red" v-html='users.count'></span>人</div>
    <div class="tcdPageCode holder"></div>
    </div>
    <div class="clearfix"></div>
    </div>

</div>

<script src="../js/sweetalert-dev.js"></script>
<script src="../js/jquery.page.js"></script>
<script>
    new Vue({
        el: "#doctor_detail",
        data: {
        users: [],
    },
    ready: function() {
       var self = this;
            $.ajax({
                type: 'POST',
                url: "user.jsp",
                data: {
                act: "patients",
            },
            success: function(res) {
                res = JSON.parse(res);
                if (res.errcode == 0) {
                self.users = res.data;
                $(".tcdPageCode").createPage({
                pageCount: self.users.page_count,
                current:self.users.current_page,
                <%--点击打印页数--%>
                backFn:function(p){
                    $.ajax({
                    type: 'post',
                    url: "user.jsp",
                    data: {
                    act:"patients",
                    page:p,
                    },
                    timeout: 3000,
                    dataType: 'json',
                    success: function(res) {
                    if (res.errcode == 0) {
                    self.users = res.data;
                    }
                },
                error: function(error) {

                }
                });
                return false;//阻止提交
                }
            });

            }
            }
        });

        laydate({
            elem: '#time_choose',
            max: laydate.now(), //+1代表明天，+2代表后天，以此类推
            isclear: false, //是否显示清空<br/>
            istoday: false, //是否显示今天<br/>
            issure: true,
                choose: function(datas) { //选择日期完毕的回调
                var keywords=$("input[name='search_people']").val();
                $.ajax({
                    type: 'post',
                    url: "user.jsp",
                    data: {
                    act:"patients",
                    keywords:keywords,
                    date:datas,
                    },
                    timeout: 3000,
                    dataType: 'json',
                    success: function(res) {
                            if (res.errcode == 0) {
                            self.users = res.data;
                    $(".tcdPageCode")[0].outerHTML = $(".tcdPageCode")[0].outerHTML;
                    $(".tcdPageCode").createPage({
                            pageCount: self.users.page_count,
                            current:self.users.current_page,
                            <%--点击打印页数--%>
                            backFn:function(p){
                                $.ajax({
                                type: 'post',
                                url: "user.jsp",
                                data: {
                                act:"patients",
                                date:datas,
                                keywords:keywords,
                                page:p,
                                },
                                timeout: 3000,
                                dataType: 'json',
                                success: function(res) {
                                if (res.errcode == 0) {
                                self.users = res.data;
                                }
                                },
                                error: function(error) {

                                }
                                });
                            return false;//阻止提交
                            }
                            });
                        }
                    },
                    error: function(error) {

                    }
                });

            }
        });
    },
        <%--搜索--%>
       methods:{
           keywords_search:function(){
             var self = this;
             var keywords=$("input[name='search_people']").val();
             var date_choose=$('.date_choose').text();
                $.ajax({
                    type: 'post',
                    url: "user.jsp",
                    data: {
                        act:"patients",
                        keywords:keywords,
                        date:date_choose,
                },
                    timeout: 3000,
                    dataType: 'json',
                    success: function(res) {
                    if (res.errcode == 0) {
                    self.users = res.data;
                $(".tcdPageCode")[0].outerHTML = $(".tcdPageCode")[0].outerHTML;
                $(".tcdPageCode").createPage({
                        pageCount: self.users.page_count,
                        current:self.users.current_page,
                        <%--点击打印页数--%>
                        backFn:function(p){
                            $.ajax({
                            type: 'post',
                            url: "user.jsp",
                            data: {
                            act:"patients",
                            keywords:keywords,
                            date:date_choose,
                            page:p,
                            },
                            timeout: 3000,
                            dataType: 'json',
                            success: function(res) {
                            if (res.errcode == 0) {
                            self.users = res.data;
                            }
                            },
                            error: function(error) {

                            }
                            });
                            return false;//阻止提交
                        }
                        });

                    }
                    },
                    error: function(error) {

                    }
                });

          }
        }

    });
</script>
</body>
</html>
